using System;
using System.ComponentModel.DataAnnotations;

namespace SIOGDE.AccesoDatos.Entidades
{
 public partial class Comando
 {
     public Comando()
     {
         Guid = System.Guid.NewGuid().ToString();
     }
     #region foreign Keys

     public virtual int GestionId_FK {get;set;}
     private Gestion GestionId_obj ;
     public virtual Gestion Gestion
      {
          get { return GestionId_obj; }
          set {
                GestionId_obj = value;
                if (GestionId_obj != null) GestionId_FK = GestionId_obj.Id; 
          }
      }

     public virtual int PersonaId_FK {get;set;}
     private Persona PersonaId_obj ;
     public virtual Persona Persona
      {
          get { return PersonaId_obj; }
          set {
                PersonaId_obj = value;
                if (PersonaId_obj != null) PersonaId_FK = PersonaId_obj.Id; 
          }
      }

     public virtual int TipoCargoComandoId_FK {get;set;}
     private TipoCargoComando TipoCargoComandoId_obj ;
     public virtual TipoCargoComando TipoCargoComando
      {
          get { return TipoCargoComandoId_obj; }
          set {
                TipoCargoComandoId_obj = value;
                if (TipoCargoComandoId_obj != null) TipoCargoComandoId_FK = TipoCargoComandoId_obj.Id; 
          }
      }

     public virtual int UnidadMilitarId_FK {get;set;}
     private UnidadMilitar UnidadMilitarId_obj ;
     public virtual UnidadMilitar UnidadMilitar
      {
          get { return UnidadMilitarId_obj; }
          set {
                UnidadMilitarId_obj = value;
                if (UnidadMilitarId_obj != null) UnidadMilitarId_FK = UnidadMilitarId_obj.Id; 
          }
      }
     #endregion
     public virtual int   Id { get; set;}

     
     [StringLength(50, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "Guid")]
     public virtual string   Guid { get; set;}

     [Required(ErrorMessage="FechaRegistro es requerido.")]
     [DataType(DataType.Date)]
     [Display(Name = "FechaRegistro")]
     public virtual DateTime   FechaRegistro { get; set;}

     [Required(ErrorMessage="FechaAsignacion es requerido.")]
     [DataType(DataType.Date)]
     [Display(Name = "FechaAsignacion")]
     public virtual DateTime   FechaAsignacion { get; set;}

     [StringLength(50, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "RegistradoPor")]
     public virtual string   RegistradoPor { get; set;}

     [Required(ErrorMessage="OrdenEmitidaPor es requerido.")]
     [StringLength(50, ErrorMessage = "{0} debe tener al menos {2} caracteres.", MinimumLength = 2)]
     [Display(Name = "OrdenEmitidaPor")]
     public virtual string   OrdenEmitidaPor { get; set;}

     [Required(ErrorMessage="EsPredeterminado es requerido.")]
     [Display(Name = "EsPredeterminado")]
     public virtual bool   EsPredeterminado { get; set;}
 }
}

